var mongoose = require('mongoose'),
    Schema = mongoose.Schema,
    Disciplina = require('./disciplina.model').DisciplinaSchema,
    Projeto = require('./projeto.model').ProjetoSchema;


var Professor = new Schema({
    nome: String,
    email: {type: String, index: {unique: true, dropDups: true}},
    username: {type: String, index: {unique: true, dropDups: true}},
    password: String,
    departamento: String,
    roles: {type: [String], default: ['manager']},
    matricula: String,
    preferidas: [Disciplina],
    disciplinas: [Disciplina],
    projetos: [Projeto]
});

mongoose.model('Professor', Professor);

module.exports.ProfessorSchema = Professor;
module.exports.Professor = mongoose.model('Professor');
